Images and particularly multivalue images include a very large amount of information. Upon storage or transmission of such image, the large data amount causes a problem. For this reason, upon storage or transmission of image, employed is high efficiency coding to reduce the amount of image data by eliminating redundancy of image or allowing the degradation of image to a degree that degradation of image quality is not visually recognizable. For example, in the JPEG method recommended by the ISO and the ITU-T as an international standardized still picture coding method, image data is compressed by performing discrete cosine transform (DCT) by block (8 pixels×8 pixels) to obtain DCT coefficients, then quantizing the respective DCT coefficients, and entropy encoding the quantized results. Other compression techniques such as H261 and MPEG 1/2/4 methods also utilize the DCT transform.
In the JPEG method, a lossless coding mode was standardized such that a compressed/decompressed image completely corresponds with its original image, however, at that time, a lossless transform technique was not fully studied and lossless transform using DCT was not realized. Accordingly, the lossless coding was realized by predictive coding in several pixel units using a technique different from a DCT-used block transform coding.
Thereafter, a standard coding technique specialized for lossless coding (JPEG-LS) was standardized, and in the further-standardized JPEG 2000, both lossless transform and general compression with degradation (lossy transform) are realized.
In recent years, a DCT lossless transform has been studied to try to realize JPEG lossless compression based on the currently popularized DCT transform. The DCT used in the JPEG compression is an 8 point DCT transform. As shown in FIG. 1, the 8 point DCT is divided into four 2-point transforms, a 4-point DCT and a 4-point orthogonal transform. The 4-point DCT and the 4-point transform are further divided into 2-point transforms, but here the 4-point DCT will be described.
As shown in FIG. 2, the 4-point DCT is divided into four 2-point transforms 201 to 204. A lossless transform can be realized by changing the respective 2-point transforms to lossless transforms. The change of the 2-point transform to lossless transforms can be realized by a ladder network and rounding, as introduced by Kuninori Komatsu and Kaoru Sezaki, “Reversible Discrete Cosine Transform and Its Application to Image Information Compression” (Shingaku Gihou, IE97-83, pp. 1 to 6, November 1997) (Document 1).
In this method, input/output data are interchanged so as to obtain “1” as determinant values of 2-point transform matrix, then the 2-point transform becomes a rotational transform. It is well known in the field of geometry that a 2-point transform can be realized with three two-dimensional shear transforms. In a 2×2 transform matrix in the two-dimensional shear transform, two diagonal components are “1”, and one of two off-diagonal components is “0”, and the other one is a parameter corresponding to an angle of inclination.
In a signal flow of the shear transform, one shear transform is replaced with a single-step ladder operation including multiplication processing and addition processing. Accordingly, the 2-point rotational transform is realized with three-step ladder operation as shown in FIG. 3. In FIG. 3, the 2-point rotational transform can be easily changed to a lossless transform by rounding values after multiplication processing in each step of ladder operation. That is, the ladder operation in lossless transform includes multiplier 311, 321 and 331, rounding units 313, 323 and 333, and adder 315, 325 and 335 (in some cases, these adder may be subtractor). In a case where a rotational angle is θ, multiplication coefficients in the multiplication processors 311, 321 and 331 are TAN(θ/2), −SIN(θ) and TAN(θ/2).
Then, rounding processing is performed so as to round the results of multiplication by one step of ladder operation, thereby rounding errors occur unless the results of multiplication are integers, and the rounding errors are included in output data.
Conventionally, the 4-point orthogonal lossless transform including four 2-point rotational transforms is arranged as shown in FIG. 4.
In FIG. 4, numerals 401 to 404 denote 2-point rotational transforms each is three-step ladder operation as shown in FIG. 3. The entire lossless 4-point orthogonal transform has 12 steps of ladder operation and 12 rounding processings (R). The number of rounding errors increases in proportion to the number of rounding processings.
On the other hand, in the above document 1, the lossless transform is realized by dividing a 4-point orthogonal transform into five four-dimensional shear transforms. As a single n-dimensional shear transform corresponds (n−1) ladder operations, in the 4-point orthogonal transform, (4−1)×5=15 ladder operations are required. The number equals the number of multiplication processings. However, by virtue of shear transform, the number of rounding processings can be greatly reduced. In a multidimensional shear transform, as the ends of ladder operations (data as the subjects of addition) are concentrated to one data, these data are added up then rounding processing is performed. Thus the number of rounding processings can become one. In the 4-point orthogonal transform in the above document 1, five rounding processings are performed totally.
In use of results of non-lossless transform, for example results of linear transform, in the above lossless transformed data, the rounding errors increase in proportion to the number of rounding processings and the accuracy of transform is degraded.
Upon decoding of coded data generated by entropy coding after lossless transform, there is no problem if an inverse lossless transform corresponding to the lossless transform is necessarily performed. However, in a case where data JPEG-encoded by using a lossless DCT transform is decoded with a general JPEG decoder, the difference of lossless DCT accuracy appears as a difference of decoded image signal, which influences the image quality. This means that the lossless transform should desirably be close to linear transform as much as possible.
Further, in a case where the same type of transform is used in lossless coding and lossy coding, a lossless transform is required. In consideration of coding efficiency upon lossy coding, the lossless transform should desirably be close to a linear transform as much as possible.
In the conventional lossless 4-point orthogonal transform processing, the number of multiplication processings is 12 or 15. If the number of multiplications is smaller, the number of rounding processings is 12, while if the number of rounding processings is 5, the number of multiplications is 15. To increase the transform accuracy so as to reduce the errors in linear 4-point orthogonal transform, it is necessary to select a method with a smaller number of rounding processings. However, as the number of operations increases, the processing speed is lowered, or the hardware scale increases.
Further, if a high priority is placed on the processing speed and hardware scale, the number of rounding processings is 12, and the transform accuracy is seriously low. In this manner, it has been difficult to improve both the transform accuracy and the processing speed (hardware scale).